<script>
	import update from "./utils/update.js";
	import permission from "@/utils/permission";
	import utils from "./utils";

	export default {
		onLaunch: async function() {
			// update.update()
			if (!uni.getStorageSync("token")) {
				const data = await permission.getUserInfo();
				const {
					code
				} = await permission.getCode();
				const loginResult = await this.$api.wxLogin({
					code
				});
				const token = loginResult.data;

				uni.setStorageSync("token", token);
				const currentPage = utils.getCurrentPage();
				// console.log(currentPage.data.vvvvvvvvvvvvvvvv, '11111111111')
				currentPage.onLoad(currentPage.data.vvvvvvvvvvvvvvvv) || currentPage.onShow();
			}
		},
		onShow() {},
		onHide() {},
	};
</script>

<style lang="scss">
	// @import "uview-ui/index.scss";
</style>
